/*  1:   */package com.github.binarywang.demo.wechat.service.impl;
/*  2:   */
/*  3:   */import com.github.binarywang.demo.wechat.dao.UserMapper;
/*  4:   */import com.github.binarywang.demo.wechat.model.User;
/*  5:   */import com.github.binarywang.demo.wechat.service.WxUserService;
/*  6:   */import java.util.List;
/*  7:   */import org.springframework.beans.factory.annotation.Autowired;
/*  8:   */import org.springframework.stereotype.Service;
/*  9:   */
/* 11:   */@Service("wxUserService")
/* 12:   */public class WxUserServiceImpl
/* 13:   */  implements WxUserService
/* 14:   */{
/* 15:   */  @Autowired
/* 16:   */  private UserMapper userMapper;
/* 17:   */  
/* 18:   */  public User saveUser(User user)
/* 19:   */  {
/* 20:20 */    List<User> userList = this.userMapper.selectAll();
/* 21:21 */    if ((userList == null) || (userList.size() == 0)) {
/* 22:22 */      user.setIsManager("2");
/* 23:   */    }
/* 24:24 */    User tempUser = this.userMapper.selectByPrimaryKey(user.getOpenId());
/* 25:25 */    if (tempUser == null) {
/* 26:26 */      this.userMapper.insert(user);
/* 27:   */    } else {
/* 28:28 */      this.userMapper.updateByPrimaryKeySelective(user);
/* 29:   */    }
/* 30:30 */    return this.userMapper.selectByPrimaryKey(user.getOpenId());
/* 31:   */  }
/* 32:   */  
/* 33:   */  public int edit(User user)
/* 34:   */  {
/* 35:35 */    return this.userMapper.updateByPrimaryKeySelective(user);
/* 36:   */  }
/* 37:   */  
/* 38:   */  public int delete(String openId)
/* 39:   */  {
/* 40:40 */    return this.userMapper.deleteByPrimaryKey(openId);
/* 41:   */  }
/* 42:   */  
/* 43:   */  public List<User> list()
/* 44:   */  {
/* 45:45 */    return this.userMapper.selectAll();
/* 46:   */  }
/* 43:   */  public List<User> list_(String content)
/* 44:   */  {
	/* 45:45 */    return this.userMapper.selectByContent(content);
/* 46:   */  }
/* 47:   */}


/* Location:           C:\Users\Windows\Desktop\wx\BOOT-INF\classes\
 * Qualified Name:     com.github.binarywang.demo.wechat.service.impl.WxUserServiceImpl
 * JD-Core Version:    0.7.0-SNAPSHOT-20130630
 */